package com.ruoyi.web.controller.shopping;

import java.util.List;

import com.ruoyi.common.core.domain.entity.StoreUserRole;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.store.domain.Store;
import com.ruoyi.store.service.IStoreService;
import com.ruoyi.store.service.IStoreUserRoleService;
import com.ruoyi.store.service.impl.StoreUserRoleServiceImpl;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.constant.DicConstants;
//import com.ruoyi.shopping.domain.AppointmentRecord;
//import com.ruoyi.shopping.service.IAppointmentRecordService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 预约记录Controller
 *
 * @author scx
 * @date 2022-06-10
 */
//@RestController
//@RequestMapping("/shopping/appointmentRecord")
public class AppointmentRecordController extends BaseController
{/*
    @Autowired
    private IAppointmentRecordService appointmentRecordService;
    @Autowired
    private IStoreUserRoleService storeUserRoleService;
    @Autowired
    private IStoreService storeService;

    *//**
     * 查询预约记录列表
     *//*
    @PreAuthorize("@ss.hasPermi('shopping:appointmentRecord:list')")
    @GetMapping("/list")
    public TableDataInfo list(AppointmentRecord appointmentRecord)
    {
        startPage();
        //获取预约的门店信息
        if (appointmentRecord.getStoreId()!= null) {
            Store store = storeService.selectStoreById(Long.valueOf(appointmentRecord.getStoreId()));
            appointmentRecord.setStoreName(store.getStoreName());
        }

        List<AppointmentRecord> list = appointmentRecordService.selectAppointmentRecordList(appointmentRecord);
        return getDataTable(list);
    }

    *//**
     * 导出预约记录列表
     *//*
    @PreAuthorize("@ss.hasPermi('shopping:appointmentRecord:export')")
    @Log(title = "预约记录", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(AppointmentRecord appointmentRecord)
    {
        List<AppointmentRecord> list = appointmentRecordService.selectAppointmentRecordList(appointmentRecord);
        ExcelUtil<AppointmentRecord> util = new ExcelUtil<AppointmentRecord>(AppointmentRecord.class);
        return util.exportExcel(list, "预约记录数据");
    }

    *//**
     * 获取预约记录详细信息
     *//*
    @PreAuthorize("@ss.hasPermi('shopping:appointmentRecord:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(appointmentRecordService.selectAppointmentRecordById(id));
    }

    *//**
     * 新增预约记录
     *//*
    @PreAuthorize("@ss.hasPermi('shopping:appointmentRecord:add')")
    @Log(title = "预约记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AppointmentRecord appointmentRecord)
    {
        return toAjax(appointmentRecordService.insertAppointmentRecord(appointmentRecord));
    }

    *//**
     * 修改预约记录
     *//*
    @PreAuthorize("@ss.hasPermi('shopping:appointmentRecord:edit')")
    @Log(title = "预约记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AppointmentRecord appointmentRecord)
    {
        appointmentRecord.setUpdateType(DicConstants.BUSINESS_Manager.getCode());
        return toAjax(appointmentRecordService.updateAppointmentRecord(appointmentRecord));
    }

    *//**
     * 删除预约记录
     *//*
    @PreAuthorize("@ss.hasPermi('shopping:appointmentRecord:remove')")
    @Log(title = "预约记录", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(appointmentRecordService.logicDeleteAppointmentRecord(ids,DicConstants.BUSINESS_Manager.getCode(),SecurityUtils.getUserId()));
    }*/
}
